package com.le.tester.javaThink.fifth.chapter24_ConcurrentProgramming;

import java.util.concurrent.CompletableFuture;

/**
 * createTime：2021/8/20 15:08
 * description：CompletableApplyAsync
 */
public class CompletableApplyAsync {
    public static void main(String[] args) {
        CompletableFuture<Machina> cf = CompletableFuture.completedFuture(new Machina(0))
                .thenApplyAsync(Machina::work)
                .thenApplyAsync(Machina::work)
                .thenApplyAsync(Machina::work)
                .thenApplyAsync(Machina::work);
        System.out.println(cf.join());
    }
}
